import com.heima.Main;
import com.heima.file.service.FileStorageService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.FileInputStream;

@SpringBootTest(classes = Main.class)
@RunWith(SpringRunner.class)
public class MinIOTest2 {
    //把list.html温江上传到minio中，并且可以在浏览器中访问
    @Autowired
    private FileStorageService fileStorageService;

    @Test
    public void testUpdateImgFile(){
        try {
            FileInputStream fileInputStream = new FileInputStream("D:\\list.html");
            String filePath = fileStorageService.uploadImgFile("", "list3.html", fileInputStream);
            System.out.println(filePath);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
